package metamodel.parser;

import java.util.List;

/**
 * User: fleipold
 * Date: 02-Dec-2007
 * Time: 19:13:37
 */
public class ChainedResolver implements ClassResolver {

    final List<ClassResolver> resolvers;

    public ChainedResolver(List<ClassResolver> resolvers) {
        this.resolvers = resolvers;
    }

    public Class resolveClass(String name) {
        for (ClassResolver classResolver : resolvers) {
            Class resolved = classResolver.resolveClass(name);
            if (resolved != null) {
                return resolved;
            }
        }
        return null;
    }
}